package com.liaozibo.mybatis.plus.demo.project.user.entity;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @Author: liaozibo
 * @since: 2021/3/30
 **/
public enum GradeEnum {
    PRIMARY(1, "小学"), SECONDARY(2, "中学"),  HIGH(3, "高中");

    GradeEnum(int code, String descp) {
        this.code = code;
        this.descp = descp;
    }

    @EnumValue//标记数据库存的值是code
    private final int code;

    @JsonValue
    private final String descp;
}
